package org.itstack.chain;

/**
 * 总经理审批处理器
 * 处理金额在1000-5000元之间的申请
 */
public class GeneralManagerHandler extends AbstractApprovalHandler {
    
    private static final double MIN_AMOUNT = 1000.0;
    private static final double MAX_AMOUNT = 5000.0;
    
    public GeneralManagerHandler() {
        super("总经理");
    }
    
    @Override
    public ApprovalResult handleRequest(ApprovalRequest request) {
        double amount = request.getAmount();
        
        if (amount > MIN_AMOUNT && amount <= MAX_AMOUNT) {
            // 总经理可以审批1000-5000元的申请
            return new ApprovalResult(true, getHandlerName(), 
                "总经理审批通过，金额：" + amount + "元");
        }
        
        // 超出权限，返回null让下一个处理器处理
        return null;
    }
}
